Skip to content

Fix logging/setLevel to return empty hash per MCP specification#230

Open
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:fix_logging_set_level
Open

Fix logging/setLevel to return empty hash per MCP specification#230
koic wants to merge 1 commit intomodelcontextprotocol:mainfrom
koic:fix_logging_set_level

Conversation

@koic
Copy link
Member

@koic koic commented Feb 16, 2026

Motivation and Context

This PR fixes logging/setLevel to return empty hash per MCP specification. The MCP specification requires logging/setLevel to return an empty result on success, not nil or the LoggingMessageNotification object. Specification reference:
https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging

Fixes #229.

How Has This Been Tested?

Added a repro test to verify the fix and prevent regression.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

This PR fixes `logging/setLevel` to return empty hash per MCP specification.
The MCP specification requires `logging/setLevel` to return an empty result
on success, not nil or the `LoggingMessageNotification` object.

Specification reference:
https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging

Fixes modelcontextprotocol#229.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection failed: unrecognised keys "level"

2 participants